package com.example.demo.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: FKJGFK
 * @Date: 2021/5/7 16:44
 * @Description: APP用户安装日志 消费者
 */
@Slf4j
@Component
public class AppInstallConsumerListener {

    @KafkaListener(topics = "${topic.AppInstallLog}", containerFactory = "batchFactory")
    public void listen(List<ConsumerRecord<String, String>> consumerRecord) {
        log.info("AppInstallConsumerListener-> 主题:{}, 数量: {}",
                System.getProperty("topic.AppInstallLog"), consumerRecord.size());
        //todo something here

    }
}

